package demo3;

interface IShape{
    void draw();
}

class Rect implements IShape{
    @Override
    public void draw() {
        System.out.println("矩形");
    }
}

class Flower implements IShape{
    @Override
    public void draw() {
        System.out.println("一朵花儿！");
    }
}

class Cycle implements IShape{

    @Override
    public void draw() {
        System.out.println("圆圈");
    }
}

public class Test2 {
    public static void drawMap(IShape iShape){
        iShape.draw();
    }
    public static void main(String[] args) {
        Rect rect = new Rect();
        drawMap(rect);
        drawMap(new Cycle());
        drawMap(new Flower());

    }
}
